<template>
  <div class="login">
    <!-- 顶部 -->
    <div class="w">
      <img src="@/assets/img/logo.png" alt="" />
      <h3>欢迎登录</h3>
      <p>
        进入网站首页 <i class="iconfont icon-angle-right"></i
        ><i class="iconfont icon-angle-right"></i>
      </p>
    </div>
    <!-- 登录内容 -->
    <section class="login-section">
      <div class="wrapper">
        <nav>
          <a
            href="javascript:;"
            @click="active = 0"
            :class="{ active: active == 0 }"
            >账户登录</a
          >
          <a
            href="javascript:;"
            @click="active = 1"
            :class="{ active: active == 1 }"
            >扫码登录</a
          >
        </nav>
        <!-- 登录表单 -->
        <LoginForm v-if="active == 0"></LoginForm>
        <!-- 扫码登录 -->
        <p v-if="active == 1">二维码</p>
      </div>
    </section>
  </div>
</template>
<script>
// 引入登录表单
import LoginForm from "@/components/Login/LoginForm.vue";
export default {
  name: "AppLogin",
  components: {
    LoginForm,
  },
  data() {
    return {
      active: 0,
    };
  },
  methods: {},
};
</script>
<style lang="scss" scoped>
.login {
  width: 100%;
  height: 100%;
  background-color: white;
  .w {
    height: 132px;
    // background-color: aqua;
    display: flex;
    align-items: center;
    margin: 0px 8px;
    position: relative;
    img {
      width: 200px;
    }
    h3 {
      width: 900px;
      flex: 1;
      font-size: 24px;
      font-weight: 400;
      margin-top: 38px;
      margin-left: 20px;
      color: #666;
    }
    p {
      position: absolute;
      right: 0;
      bottom: 30px;
      i {
        color: #27ba9b;
        &:first-child {
          margin-left: -5px;
        }
        &:last-child {
          margin-left: -5px;
        }
      }
    }
  }
  .login_section {
    width: 100%;
    height: 488px;
    background-color: #27ba9b;
  }
}
.login-section {
  background: url(../assets/img/login-bg.png) no-repeat center / cover;
  height: 488px;
  position: relative;
  .wrapper {
    width: 380px;
    background: #fff;
    min-height: 400px;
    position: absolute;
    left: 50%;
    top: 54px;
    transform: translate3d(100px, 0, 0);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    nav {
      height: 55px;
      border-bottom: 1px solid #f5f5f5;
      display: flex;
      padding: 0 40px;
      text-align: right;
      align-items: center;
      a {
        flex: 1;
        line-height: 1;
        display: inline-block;
        font-size: 18px;
        position: relative;
        &:first-child {
          border-right: 1px solid #f5f5f5;
          text-align: left;
        }
        &.active {
          color: #42b983;
          font-weight: bold;
        }
      }
    }
  }
}
</style>
